home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-05 / cron28.zip / MANUAL.DOC < prev    next >
Text File  |  1992-03-08  |  17KB  |  434 lines

  1.  
  2.                            CRONJR ver 2.28
  3.  
  4.                                 From
  5.  
  6.                            Software Shorts
  7.  
  8.  
  9.                   
  10.  
  11.     Requirements
  12.     ------------
  13.  
  14.     MS-DOS based machine running MS-DOS 3.30 or higher.
  15.     MS-DOS versions below 3.30 may be used, but are not
  16.     recommended, since they require CRONJR to use more memory.
  17.  
  18.  
  19.     Background
  20.     ----------
  21.  
  22.          The reason for designing CRONJR was for lack of anything
  23.     better in the MS-DOS world.  Simple but powerful programs
  24.     like  cron (part of AT&T's Unix) or Sleeper  (public domain
  25.     for HP's MPE) are non existent for PC's.
  26.  
  27.          With more and more companies moving from mini-computers
  28.     to PC based LANs, one of the many things that has been lost
  29.     was the ability to schedule the nightly reporting and
  30.     maintenance programs needed to keep a business working during
  31.     the day.
  32.  
  33.          Sure, it's possible to just write a large batch file
  34.     that will run all your programs one after another.  That
  35.     solution is fine if it meets your needs.  But if you need
  36.     programs to run at specific times, and especially if your
  37.     business revolves around a LAN, then this product is for you.
  38.  
  39.     The solution
  40.     ------------
  41.  
  42.          There are 3 methods of scheduler implementation in a DOS
  43.     environment.
  44.  
  45.     Method 1
  46.  
  47.          Make a background RAM resident program that will
  48.          pop up when it is time to run the tasks.
  49.  
  50.     Method 2
  51.  
  52.          Make a foreground program that loads the tasks as
  53.          child processes.
  54.  
  55.     Method 3
  56.  
  57.          Make a transient program that is only in memory
  58.          when it is needed.  Therefore, all memory is
  59.          available for the task.
  60.  
  61.  
  62.     Faults for method 1
  63.     --------------------
  64.  
  65.          The last thing the world needs is another RAM
  66.          resident program to eat up memory, steal clock
  67.          cycles, and substitute custom interrupt vectors.  Most
  68.          LAN users already use 20-70k for their network shell,
  69.          and even more if they are running a NETBIOS emulator.
  70.  
  71.          The way most resident schedulers work is to stuff the
  72.          keyboard when it is time to execute a task.  This
  73.          method can be seen in various automatic tape backup
  74.          programs.  This method is unreliable since the assumption
  75.          is made that the DOS prompt is available, the command
  76.          line is clear, and the path is set.
  77.  
  78.     Faults for method 2
  79.     -------------------
  80.  
  81.          This method requires too much memory.  If you want to
  82.          run a batch file then you have to load another version
  83.          of COMMAND.COM on top of the parent scheduler.
  84.  
  85.     Why method 3 is so swell
  86.     ------------------------
  87.  
  88.          1. It is so simple.  It relies heavily on two simple
  89.        operating system level batch files.
  90.  
  91.          2. It is not RAM resident so it uses no memory(*).
  92.  
  93.          *  The dreaded asterisk - If you are using a DOS
  94.        version below 3.3 then around 23k is lost because
  95.        COMMAND.COM needs to be invoked a second time.
  96.        It is strongly recommend that DOS 3.30 or above is
  97.        used.
  98.  
  99.  
  100.     How it works
  101.     ------------
  102.  
  103.          1.  The schedule file CRONJR.SCH is created by you. It
  104.     contains the timing parameters for the tasks to be executed.
  105.  
  106.          2. The master batch file, CRONJR.BAT, is loaded from the
  107.     command line.  That is your last intervention.
  108.  
  109.          3. The work file, CRONWK.BAT, is deleted by CRONJR.BAT.
  110.  
  111.          4. The scheduler program, CRON.EXE, is loaded and the
  112.     schedule file CRONJR.SCH is read.
  113.  
  114.          5. When the time comes to execute a process CRON.EXE
  115.     dumps its scheduling information to CRONJR.JOB, writes the
  116.     CRONWK.BAT bat file and unloads from memory to return control
  117.     to CRONJR.BAT.
  118.  
  119.          6. If CRONJR.BAT can find CRONWK.BAT then the CRONWK.BAT
  120.     work file is called/executed.
  121.  
  122.          7. Upon completion of CRONWK.BAT, control is returned to
  123.     CRONJR.BAT which then executes CRONJR.BAT (thus ending the
  124.     original CRONJR.BAT execution) with the parameter RELOAD
  125.     which is passed to CRON.EXE in step 4, which causes the file
  126.     CRONJR.JOB to be loaded rather than the file CRONJR.SCH .
  127.  
  128.  
  129.          Hard to follow?  Try this one. It is the remedial
  130.     version.
  131.  
  132.     CRONJR.BAT -> CRON.EXE -> CRONWK.BAT (YOUR TASK) ->CRONJR.BAT
  133.         A.           B.            C.                     A.
  134.  
  135.     Installation
  136.     ------------
  137.  
  138.          Create a directory for CRONJR, any name will do, and
  139.     copy the CRON.EXE program into the new directory. If you are
  140.     going to use CRONJR on a LAN with multiple machines running
  141.     CRONJR, then you must make a separate directory for each
  142.     machine.
  143.    
  144.     Examples:
  145.  
  146.          F:\CRON\386
  147.          F:\BOB\CRON
  148.          F:\CRON\486
  149.          F:\ACCTNG\CRON
  150.    
  151.          Each directory must contain its own CRONJR.SCH file and
  152.     its own unique CRONJR.BAT file.  A path may be set to point
  153.     to the location of CRON.EXE.
  154.    
  155.           For each CRONJR directory created, type CRON START at
  156.     their respective DOS prompt.  Such as:
  157.  
  158.          F:\CRON\386>cron start
  159.  
  160.           For added security we recommend disabling the DOS Shell
  161.     by using the DISABLE parameter.  Such as:
  162.  
  163.          F:\CRON\386>cron start disable
  164.  
  165.          Either of these will create the CRONJR.BAT file which is 
  166.     specific to its home directory.  If you type out the CRONJR.BAT file
  167.     you will understand.
  168.  
  169.          Create a flat ASCII file (no tabs) named CRONJR.SCH or
  170.     edit the one on the distribution diskette.  Enter one task
  171.     per line using the following format.
  172.  
  173.     minute  hour  day_of_month  month  day_of_week  executable parm_list
  174.  
  175.          Example
  176.          -------
  177.  
  178.          50  16  *   *     MOTUWETHFR    f:\public\bin\killuser.EXE
  179.          0   17  *   *     MOTUWETHFR    f:\mtn_tape\databack.bat
  180.          0   5   *   *     MO            g:\acctng\weekly.bat
  181.          0   1   1   *   SUMOTUWETHFRSA  G:\ACCTNG\MONTHEND.EXE
  182.          0   1   1   1   SUMOTUWETHFRSA  G:\ACCTNG\YEARLY.EXE
  183.          49  16  *   *     MOTUWETHFR    C:\FUNNY\GOHOME.EXE
  184.          2i  *   *   *     MOTUWETHFR    F:\stream\kevin.bat
  185.          *   1i  *   *     MOTUWETHFR    q:\hourly\bak2work.exe
  186.          30  12  *   *         WE        nopath.com
  187.          06  30  *   *   SA              u:\palitape\tna2tape.exe /a q /optic
  188.     
  189.     Type CRONJR at the DOS prompt and you are finished.
  190.  
  191.          Field definitions
  192.          -----------------
  193.  
  194.          minute......: the minute of the hour you want your
  195.                        schedule to execute, 0 through 59.
  196.          hour........: the hour of the day in military time,
  197.                        0 through 23.
  198.          day_of_month: the day of the month 1 through 31.
  199.          month.......: the month of the year 1 through 12.
  200.          day_of_week.: the day of the week, SU MO TU WE TH FR SA.
  201.          executable..: a DOS executable string, .BAT, .EXE, and
  202.                        .COM files with a maximum combined path of
  203.                        64 characters.   EXTENTIONS MUST BE USED!!!!!!
  204.          parm_list...: optional parameters to be passed to the executable.
  205.                        Maximum of 128 characters. 
  206.  
  207.          Wild cards and increments
  208.          -------------------------
  209.  
  210.          *: execute on every occurrence - not used by day_of_week .
  211.          i: execute in increments - only applies to minute and
  212.             hour.  The 7th line in the example shows 2i which
  213.             means execute in 2 minute increments.  In theory this
  214.             task could be executed 30 times a hour.  Obviously *
  215.             must be used for every level after the first i .
  216.             Combinations of i in the minute and hour are not
  217.             allowed.  The expected outcome is that only the
  218.             hour increment will be used.  If 'i' is used with the
  219.             hour, then the minute should be *, otherwise
  220.             execution will occur in x hour increments, but only
  221.             on the specified minute.  Thus 30 1i does not mean
  222.             execute every 90 minutes, but execute hourly on the
  223.             30th minute of the hour.
  224.  
  225.          Launch time
  226.          -----------
  227.  
  228.              Task checking and launching occur on the 1st second of
  229.          the minute.
  230.  
  231.  
  232.     EXTREMELY IMPORTANT
  233.     -------------------
  234.  
  235.          Be very careful when assigning launch times.  A 'feature'
  236.     of CRONJR is that it only launches tasks when CRON.EXE is
  237.     resident.  Example: you have 2 tasks set to execute at 19:00,
  238.     each takes 20 minutes to run, and few tasks scheduled at
  239.     19:15.  At 19:00 all 19:00 tasks are tagged for launching and
  240.     the first task will be launched at 19:00.  The 2nd task will
  241.     be launched when CRON.EXE is reloaded and thus effectively
  242.     launched at 19:20.
  243.  
  244.          Well it is now 19:40 and all tasks scheduled from 19:01
  245.     through 19:40 have missed their launch window.
  246.  
  247.          To prevent this from happening you should do the
  248.     following.  Schedule enough time between tasks.  The 19:15
  249.     tasks in the example should have been set later to 20:00, or
  250.     earlier to 19:00.  Had they been scheduled at 19:00 then they
  251.     would have run as part of the 19:00 launching.
  252.  
  253.  
  254.     Proper scheduling
  255.     -----------------
  256.  
  257.          The best way to debug a faulty schedule is to run
  258.     CRON.EXE instead of CRONJR.BAT, and use the F1 key to exit to
  259.     DOS and change the time.  Inspect the CRONWK.BAT file that is
  260.     created.
  261.  
  262.          There is no limit to the number of tasks you can put
  263.     into the CRONJR.SCH file.
  264.  
  265.  
  266.     Common problems
  267.     ---------------
  268.        CRONJR program is running, and exits to DOS and does nothing.
  269.           Problem: Running CRON instead of CRONJR.
  270.           Problem: Did not run CRON START in the execution directory.
  271.  
  272.        CRONJR does not execute the programs listed in CRONJR.SCH
  273.           Problem: Could not find the programs.  Need to specify the
  274.                    path in the CRONJR.SCH file or verify that programs
  275.                    are in the current directory.
  276.           Problem: You did not specify .BAT, .EXE, or .COM . 
  277.           Problem: Your scheduling parameters are incorrect. Most 
  278.                    likely day_of_the_week not included.  I.e. You
  279.                    are testing on Saturday a job you have set up
  280.                    to run Monday through Friday.
  281.  
  282.        CRONJR playes this obnoxious fight song when it executes.
  283.           Problem: Running the evaluation version.
  284.  
  285.  
  286.     The competition
  287.     ---------------
  288.  
  289.          It was mentioned earlier that there are no programs
  290.     available similar to CRONJR.  Well that is no longer true.
  291.     There is a product called PS-Batch from Brightwork Development.
  292.     Its list price is around $595.00, it must be licensed per
  293.     file server, it uses about 40k of memory and it is limited
  294.     to Netware.  CRONJR on the other hand is available for
  295.     $35.00, licensing is per site - not batch station or server,
  296.     it uses 0k of memory and will work on ANY LAN or stand alone
  297.     PC.
  298.  
  299.          I am sure PS-Batch is a fine product and has many more
  300.     features than CRONJR.  Many of these features were purposely
  301.     designed out of the original versions of CRONJR.
  302.  
  303.     Anomalies and hints
  304.     -------------------
  305.  
  306.          There are two known anomalies and one other point that you
  307.     need to remember.
  308.  
  309.          Anomaly 1.  Cronjr only executes tasks on the 1st second
  310.     of the minute.  Example.  If you had 3 tasks that each take 5
  311.     seconds to complete, and they are all scheduled to launch at
  312.     19:00 then they will be effectively launched at 19:00, 19:01
  313.     and 19:02.  This feature was designed into the product.
  314.  
  315.          Anomaly 2.  Anomaly 2 arises out of anomaly 1.  Example.
  316.     If you set up a schedule that has 3 jobs, each set to run in
  317.     increments of 10 minutes (10i * * * ...), you would assume
  318.     that they would execute at the 10, 20, 30, 40, 50, 00 minute
  319.     clock demarcations (assuming that the first launch minute was
  320.     hh:00) and always launch one after the other. In reality this
  321.     is not true.
  322.  
  323.  
  324.          The first launching schedule would look like this.
  325.  
  326.          1a. Job #1 launches at the first available minute.
  327.  
  328.          2a. Job #2 launches at the first available minute
  329.         after Job #1 completes.
  330.  
  331.          3a. Job #3 launches at first available minute after Job
  332.         #2 completes.
  333.  
  334.          The second and subsequent launchings might look like
  335.     this.
  336.  
  337.          1b. Job #1 launches 10 minutes after its's first
  338.         launching or at the first available minute after
  339.         Job #3 finishes or it may launch the first available
  340.         minute after Job #1 if Job #1 takes more than 10
  341.         minutes.
  342.  
  343.          2b. and 3b.  Who knows.
  344.  
  345.          The best way to get around this confusion is to do one
  346.     of three things.
  347.  
  348.          1. Carefully plan and test your incremental launchings.
  349.  
  350.          2. Rather than make your launchings incremental, make
  351.     them minute specific.  This may involve multiple line entries
  352.     into the CRONJR.SCH file for he same job at different times.
  353.  
  354.          3. Make Jobs 1, 2 and 3 one job.
  355.  
  356.          The one thing you must remember.  The CRONJR.SCH file is
  357.     only loaded at the initial load time.  If you are running
  358.     CRONJR on a LAN and CRONJR is running on a remote machine and
  359.     you modify the remote machine's CRONJR.SCH file,  the remote
  360.     CRONJR will not reflect any of the changes made in the new
  361.     CRONJR.SCH file until the remote CRONJR is aborted and
  362.     reloaded.
  363.  
  364.  
  365.     Getting legal
  366.     -------------
  367.  
  368.          Software Shorts hereby disclaims all warranties relating
  369.     to this software, whether expressed or implied, including
  370.     without limitation any implied warranties of merchantability
  371.     or fitness for a particular purpose.  Software Shorts will
  372.     not be liable for any special, incidental, consequential,
  373.     indirect or similar damages due to loss of data or any other
  374.     reason, even if Software Shorts or an agent of Software
  375.     Shorts has been advised of the possibility of such damages.
  376.     Software Shorts will not be liable for any damages due to
  377.     malicious third party augmentation of the executable program.
  378.     In no event shall Software Shorts's liability for any damages
  379.     ever exceed the price paid for the license to use software,
  380.     regardless of the form of the claim.  The person using the
  381.     software bears all risk as to the quality and performance of
  382.     the software.
  383.  
  384.     Acknowledgements
  385.     ----------------
  386.  
  387.     Unix, cron and AT&T are registered trademarks of American
  388.          Telephone and Telegraph Corporation.
  389.     MPE and HP are copyrights of Hewlett Packard Company.
  390.     Sleeper is available through INTEREX
  391.     MS-DOS is a registered trademarks of Microsoft Corporation.
  392.     NetWare is a registered trademark of Novell Incorporated
  393.     PS-Batch is a trademark of Brightwork Development Incorporated
  394.  
  395.     Software Shorts is not affiliated with any of the above
  396.     mentioned companies.
  397.  
  398.     Technical Support
  399.     -----------------
  400.        
  401.         Questions can be sent to CompuServe ID 70731,2507
  402.  
  403.  
  404.     Licensing
  405.     ---------
  406.  
  407.         CRONJR is licensed by site.  This means that if you have 50
  408.     machines in 1 building then they can all use the same copy of the
  409.     software, with or without a LAN.  Or if you have 10 offices in
  410.     different buildings, then you need to purchase 10 copies of the
  411.     software.  Or if those 10 offices are in different buildings
  412.     but are connected to a WAN to your office with the 50 machines
  413.     and the one purchased copy, then those 10 offices still have to 
  414.     purchase their own copies of the software since they are in 
  415.     different building.
  416.     
  417.  
  418.     One last word
  419.     -------------
  420.    
  421.          Software Shorts is dedicated to the creation and
  422.     dissemination of short, single focus, utility programs for
  423.     programmers.  Hence the name Software Shorts.  In the
  424.     tradition of true software geeks, Software Shorts believes
  425.     utility programs should be inexpensive, if not free, and in
  426.     the hands of as many people as possible.  However, Software
  427.     Shorts utility programs may not be distributed by any
  428.     individual or corporation as part of a commercial software
  429.     release, unless the utility has been licensed to that
  430.     individual or corporation for such distribution.
  431.    
  432.          The first version of CRONJR was released in November of
  433.     1988.  
  434.